      SUBROUTINE WSPERROR (MESSNO,ISTOP)
C
      INCLUDE 'WASP.CMN'
C
      CHARACTER*50  TXTMP
C
      CHARACTER*50 TEXT(24)
C
      INTEGER  ILINES, MESTMP
C-----------------------------------------------------------------------
      ICHR=LENACT(WSPATH)
      IF (WISP)THEN
         WSPERR=WSPATH(1:ICHR)//'WASP.ERF'
      ELSE
         WSPERR='WASP.ERR'
      ENDIF
      OPEN (UNIT=98,FILE=WSPERR,STATUS='OLD', FORM='FORMATTED')
      OPEN (UNIT=97,FILE=ERRFIL,STATUS='UNKNOWN', FORM='FORMATTED')
C
      WRITE (OUT, 6000)
      WRITE (97, 6000)
 6000 FORMAT(/,/,/,5X,'* ERROR * ERROR * ERROR * ERROR * ERROR * ERROR *
     1 ERROR * ERROR *',/,/) 
      ILINES = 0
C
 1000 CONTINUE
C
      READ (98, 5000, END = 1010) MESTMP, TXTMP
 5000 FORMAT(I5,1X,A50)
C
      IF (MESSNO .GT. MESTMP) THEN
         GO TO 1000
      ELSE IF (MESSNO .LT. MESTMP) THEN
         GO TO 1010
      ELSE
        ILINES = ILINES + 1
        WRITE(OUT,6200)TXTMP
        WRITE(97,6200)TXTMP
 6200   FORMAT(10X,A50)
        TEXT (ILINES) = TXTMP
        GO TO 1000
      ENDIF
C
 1010 CONTINUE
      WRITE (OUT, 6000)
      WRITE (97, 6000)
      IF (.NOT. WISP)CALL WINOUT(TEXT,ILINES,ISTOP)
      RETURN
      END
